﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Web;

namespace HouseOfMystery.Models
{
    public class UserState
    {
        [Key]
        public string UserId { get; set; }

        private ICollection<Item> items;
        public virtual ICollection<Item> Items
        {
            get { return this.items; }
            set { this.items = value; }
        }

        private ICollection<Room> rooms;
        public virtual ICollection<Room> Rooms
        {
            get { return this.rooms; }
            set { this.rooms = value; }
        }

        public UserState()
        {
        }

        public UserState(string userId)
        {
            this.UserId = userId;

            ICollection<Room> lockedRooms = new List<Room>();
            for (int i = 0; i <= 3; i++)
            {
                lockedRooms.Add(new Room());
            }
            this.rooms = lockedRooms;

            ICollection<Item> blankItems = new List<Item>();
            for (int i = 0; i <= 10; i++)
            {
                blankItems.Add(new Item());
            }
            this.items = blankItems;
        }
    }
}